package com.ruoyi.vehicle.controller;

import com.ruoyi.vehicle.service.AiChatService;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
public class ChatController {

//    @Autowired
//    private OpenAiChatModel chatModel;

    @Autowired
    private AiChatService aiChatService;

    @RequestMapping(value = "/chat",produces = "text/html;charset=UTF-8")
    public Flux<String> chat(String memoryId,String message) {

        Flux<String> result = aiChatService.chat(memoryId,message);

        return result;
    }
}
